﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Health : MonoBehaviour
{
    private void Awake()
    {
        MyDebug.Log("Awake");
    }
    public int health = 100;
    public event Action<int> OnHealthChanged;
    public void TakeDamage(int damage)
    {
        health += damage;
           OnHealthChanged?.Invoke(health);
    }
    // Start is clled before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
